﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Net;
using System.IO;

namespace Paltop_v0._1.UI
{
    public partial class useragenttemp : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            Paltop_.Controllers.FeedController a = new Paltop_.Controllers.FeedController();
            //string output=a.getItemWithID(7);
            //Response.Write(output);
        }
        /*
        public Dictionary<String, String> Oslist = new Dictionary<string, string>();
      
        protected void UserLog()
        {
            Response.Write("OS: " + Request.Browser.Platform + "</br>");
            Response.Write("Browser: " + Request.Browser.Browser + " " + Request.Browser.Version + "</br>");
            Response.Write("IP:" + Request.UserHostAddress + "</br>");
            String os = Request.Browser.Platform;
            os = os.Substring(0, 3);
            String Browser = Request.Browser.Browser;
            Paltop_DatabaseLayer.PaltopDatabaseEntities db = new Paltop_DatabaseLayer.PaltopDatabaseEntities();
            var oslist = db.SYSOSNames.Where(p => p.OSName.Contains(os)).FirstOrDefault();
            var browserlis = db.SYSBrowserNames.Where(p => p.BrowserName.Contains(Browser)).FirstOrDefault();
            Paltop_DatabaseLayer.SYSUserLog user = new Paltop_DatabaseLayer.SYSUserLog();
            user.BrowserID = browserlis.BrowserID;
            user.OSID = oslist.OSID;
            user.Date = DateTime.Now;
            user.BrowserVersion = Request.Browser.MajorVersion;
            user.OSVersion = 0;
            user.CountryID = 0;
            string h = Session["HIEGHT"].ToString();
            string w = Session["WIDTH"].ToString();
            Int32 hieght = new Int32();
            Int32 wieght = new Int32();
            if (h != null)
            {
                hieght = Convert.ToInt32(h);
            }
            if (w != null)
            {
                wieght = Convert.ToInt32(w);
            }
            var res = re.Where(p => p.Height == hieght && p.Width == wieght).First();
            if (res != null)
                user.ResolutionID = res.ResolutionID;
            else
                user.ResolutionID = 7;
            db.SYSUserLogs.AddObject(user);
        }*/

    }
}